
<h3>产品列表</h3>

<html>
<#include "../common/header.ftl">
<link rel="stylesheet" href="/sell/css/style.css">
<body>

<div id="wrapper" class="toggled">
<#-- side bar 侧边栏-->
        <#include "../common/nav.ftl">
<#--主要内容-->
    <div id="page-content-wrapper">
        <div class="container">
            <div class="row clearfix">
            <#--数据表格的显示-->
                <div class="col-md-12 column">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>商品ID</th>
                            <th>商品名称</th>
                            <th>商品图片</th>
                            <th>价格</th>
                            <th>库存</th>
                            <th>商品描述</th>
                            <th>商品状态</th>
                            <th>商品分类</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th colspan="2" >操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        <#-- 整个循环体在 表格之外 -->
                <#list productInfoPage.content as productPage>
                <tr>
                    <td> ${productPage.productId} </td>
                    <td>${productPage.productName}</td>
                    <td><img src="${productPage.productIcon}" width="60px" height="60px" /></td>
                    <td>${productPage.productPrice}</td>
                    <td>${productPage.productStock}</td>
                    <td>${productPage.productDescription}</td>
                    <#--<td>${productPage.productStatus}</td>-->
                    <td>${productPage.getProductStatusEnum().getMessage()}</td>
                    <td>${productPage.categoryType}</td>
                    <#--<td>${productPage.getCategoryEnum().getMessage()}</td>-->
                    <td>${productPage.createTime}</td>
                    <td>${productPage.updateTime}</td>

                    <td><a href="/sell/seller/product/index?productId=${productPage.productId}"> 修改 </a></td>
                    <#if productPage.getProductStatusEnum().getMessage() == "上架">
                        <td><a href="/sell/seller/product/off_sale?productId=${productPage.productId}">下架</a></td>
                    <#else>
                        <td><a href="/sell/seller/product/on_sale?productId=${productPage.productId}">上架</a></td>
                    </#if>


                <#--<td>${orderDTO.getOrderStatusEnum(orderDTO.getOrderStatus()).getMsg()}</td>-->
                <#--如果这样的话， paystatus也得写一份代码返回，  low -->
                <#--<td>${orderDTO.getOrderStatusEnum(orderDTO.getPayStatus()).getMsg()}</td>-->
                </tr>
                </#list>
                        </tbody>
                    </table>
                </div>


                    </ul>
                </div>

            </div>
        </div>
    </div>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <ul class="pagination pull-right">
                <#if currentPage lte 1>
                    <li class="disabled"><a href="#">上一页</a></li>
                <#else>
                    <li><a href="/sell/seller/product/list?page=${currentPage-1}&size=${size}">上一页</a></li>
                </#if>

                <#list 1..productInfoPage.getTotalPages() as index>
                    <#if currentPage == index>
                        <li class="disabled"><a href="#">${index}</a></li>
                    <#else>
                        <li><a href="/sell/seller/product/list?page=${index}&size=${size}">${index}</a></li>
                    </#if>

                </#list>

                <#if currentPage gte productInfoPage.getTotalPages()>
                    <li class="disabled"><a href="#">下一页</a></li>
                <#else >
                    <li><a href="/sell/seller/product/list?page=${currentPage + 1}&size=${size}">下一页</a></li>
                </#if>


            </ul>
        </div>
    </div>
</div>
</div>


</body>
</html>